import { createStore, useStore as rootStore } from "vuex";
import { IRootState, IStoreState } from "./types";
import VuexPersistedstate from "vuex-persistedstate";
import login from "./modules/login";
const store = createStore<IRootState>({
  state() {
    return {
      name: "richey"
    };
  },
  mutations: {},
  actions: {},
  modules: { login },
  plugins: [VuexPersistedstate()]
});

export function useStore() {
  return rootStore<IStoreState>();
}
export default store;
